#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include <Display/Renders/PointRender/point_render_cuda.h>
#include <string>
using namespace PhysLeo;
namespace py = pybind11;

template<typename T>
static void declarePointRenderCpu(py::module &mod, const std::string &typestr)
{
    using class_type = PointRenderCpu<T>;
    using base_type = Render<T>;
    auto pyclass_name = std::string("PointRenderCpu") + typestr;
    py::class_<class_type, base_type, std::shared_ptr<class_type>>cls(mod, pyclass_name.c_str());

    cls.def(py::init());
    cls.def("setWritable", &class_type::setWritable);
    cls.def("setExportFilePath", &class_type::setExportFilePath);
}

template<typename T>
static void declarePointRenderCuda(py::module &mod, const std::string &typestr)
{
    using class_type = PointRenderCuda<T>;
    using base_type = PointRenderCpu<T>;
    auto pyclass_name = std::string("PointRenderCuda") + typestr;
    py::class_<class_type, base_type, std::shared_ptr<class_type>>cls(mod, pyclass_name.c_str());

    cls.def(py::init());
}

void initPointRender(py::module &m)
{
    declarePointRenderCpu<float>(m, std::string("F"));
    declarePointRenderCpu<double>(m, std::string("D"));

    declarePointRenderCuda<float>(m, std::string("F"));
    declarePointRenderCuda<double>(m, std::string("D"));
}
